#include "cpplexer.h"
#include "lexer.c"

cpplexer::cpplexer()
{

}

cpplexer::~cpplexer()
{

}

void cpplexer::createBufferFromString(char* string)
{
	yy_scan_string(string);
}

char* cpplexer::token()
{
	return this->tok;
}

int cpplexer::next()
{
	int type = yylex();
	this->tok = yytext;
	return type;
}

void cpplexer::createBufferFromFile(char* fileName)
{
	yy_create_buffer(fopen( fileName, "r" ),100000);
}